
<%@page import="com.dts.core.util.CoreHash"%>
<%@page import="com.dts.project.dao.TelephoneDAO"%>
<%@page import="java.util.Enumeration"%>
<%@page import="com.dts.project.model.TelephoneModel"%>
<%@page import="com.dts.project.model.CustomerModel"%>
<%@page import="com.dts.project.dao.CustomerDAO"%><html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<script language="JavaScript" src="scripts/gen_validatorv31.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript" src="scripts/ts_picker.js"></script>
<script language="JavaScript1.1" src="scripts/pass.js">


</script> <script type="text/javascript" src="scripts/image.js"> </script>
 <script type="text/javascript" src="scripts/general.js"> </script>
 <script type="text/javascript" src="scripts/adi.js"> </script>
 <script type="text/javascript" src="scripts/form_validation.js"> </script>
 <script>
 function inDate(){

  var date=new Date();
  document.addcomputer.rDate.value=date.getDate()+"-"+(date.getMonth()+1)+"-"+date.getYear();
  document.getElementById('exprId').innerHTML=0;
}
function offDate(){

var day=document.forms.register.elements("day");
var dayvalue=day.options[day.selectedIndex].value;
var month=document.forms.register.elements("month");
var monthvalue=month.options[month.selectedIndex].value;
var year=document.forms.register.elements("year");
var yearvalue=year.options[year.selectedIndex].value;

 var append1=dayvalue+"-"+monthvalue+"-"+yearvalue;

 var append=append1.split("-");

born = new Date(bD[2], bD[1]*1-1, bD[0]);
years = Math.floor((now.getTime() - born.getTime()) / (365.25 * 24 * 60 * 60 * 1000));

 if(years>21){
 document.register.doj.value=date.getDate()+"-"+(date.getMonth()+1)+"-"+date.getYear();;
}
 else{
   document.register.doj.value="";
   alert('Date Of Join Must Be Greater Then 21');
   
 }
<%--  var date=new Date();--%>
<%--  var checkdate=date.getDate()+"-"+(date.getMonth()+1)+"-"+date.getYear();--%>
<%--      bD=checkdate.split("-");--%>
<%--      --%>
<%--      born = new Date(bD[2], bD[1]*1-1, bD[0]);--%>
<%--	  years = Math.floor((date.getTime() - born.getTime()) / (365.25 * 24 * 60 * 60 * 1000));--%>
<%--  if(years>21){--%>
<%--  document.register.doj.value=date.getDate()+"-"+(date.getMonth()+1)+"-"+date.getYear();--%>
<%--  document.getElementById('exprId').innerHTML=0;--%>
<%--  }--%>
<%--  else{--%>
<%--  alert ('Date Of Join Must Be Greater Than 21');--%>
<%--  }--%>
}

function calAgeTo(){

  var day=document.forms.register.elements("day");
var dayvalue=day.options[day.selectedIndex].value;
var month=document.forms.register.elements("month");
var monthvalue=month.options[month.selectedIndex].value;
var year=document.forms.register.elements("year");
var yearvalue=year.options[year.selectedIndex].value;

 var append=dayvalue+"-"+monthvalue+"-"+yearvalue;

 
 now = new Date()
 bD = append.split('-');

 if(bD.length!=3){
   alert('Date Is Not Valid'); 
  document.getElementById('AgeId').innerHTML="";
  
 }
 else if(bD.length==3){
	 	born = new Date(bD[2], bD[1]*1-1, bD[0]);
	  years = Math.floor((now.getTime() - born.getTime()) / (365.25 * 24 * 60 * 60 * 1000));
    
   document.getElementById('AgeId').innerHTML=years; 
 }
}
function DOBcalc() 
{
<%--if(!register.doj.value==""){--%>
<%--  var DOjmdy = (register.doj.value).split('-'); --%>
<%--  Bjdate = new Date(DOjmdy[2],DOjmdy[0]-1,DOjmdy[1]); --%>
<%--  var bb=Bjdate.getFullYear();--%>
<%--  var DOBmdy = (register.dobirth.value).split('-'); --%>
<%--  --%>
<%--  Bdate = new Date(DOBmdy[2],DOBmdy[0]-1,DOBmdy[1]); --%>
<%--  var bDate=Bdate.getFullYear();--%>
<%--   var AgeValue=21;--%>
<%--    var Final=bb-AgeValue;--%>
<%--    if(Final>=bDate){}--%>
<%--	else{--%>
<%--  alert('Check The Joining Date Plz\n Must Be Greater Than ');--%>
<%--  --%>
<%--  }--%>
<%--  	}--%>
var date=new Date();
  register.doj.value=date;
}
function disEnable(){
  register.hQual.disabled=false;
}

function checSNO(){
  var sno=document.forms.phonedetails.sno.value;
  var tid=document.forms.phonedetails.ttypeid.value;
  if(tid == ''){
    alert("select phone type");
    return false;
  }
  if(sno == ''){
    alert("Security Number required");
    return false;
  }
}

 </script>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Lodging - Home Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/mm_lodging1.css" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
body {
	background-color: #FFFFFF;
}
-->
</style>
</head>
<body>
<table border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td height="139" colspan="6" align="left" valign="top" nowrap="nowrap"><img src="images/mm_spacer.gif" alt="" width="15" height="1" border="0" /><br />
	  <table width="100%" border="0">
        <tr>
         <td><img src="images/pidhead.jpg" alt="ds" width="100%" height="139" /></td> </tr>
      </table>
     </td>
	</tr>
	<tr bgcolor="#ffffff">
	<td colspan="6"><img src="images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
	</tr>

	<tr>
		<td class="bodyText">
		
		 <tr bgcolor="#a4c2c2">	
	<td height="36" colspan="6" class="navText style1" id="navigation">	

	
	<% String role=(String)session.getAttribute("role"); 
	if(role!=null){
	if(role.equalsIgnoreCase("ADMINISTRATOR")){
	 %>
	<jsp:include page="AdminOptions.jsp"/>
	
	<%}else if(role.equalsIgnoreCase("customer")){ %>
	
	<jsp:include page="CustOptions.jsp"/>
		
	<%}else { %>
	
	<jsp:include page="GeneralOptions.html"/>		
	<%} }else{
					response.sendRedirect("LoginForm.jsp?status=session expired login again...." );
			}	
	 %>
	 
	 	</td>	
	</tr>
	<tr bgcolor="#ffffff">
	<td colspan="6"><img src="images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
	</tr>

	<tr bgcolor="#ffffff">
	<td colspan="2" valign="top" bgcolor="#438464"><table border="0" cellspacing="0" cellpadding="0" width="230">
		<tr>
		<td width="15">&nbsp;</td>
		<td width="200" class="sidebarText" id="padding"><span class="style1"><br />
		</span><br />		</td>
		<td width="15">&nbsp;</td>
		</tr>
	</table>	</td>
	<td width="50" valign="top"><img src="images/mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
	<td width="529" valign="top"><br />
	<br />
	<table border="0" cellspacing="0" cellpadding="0" width="440">
		
		<tr>
		<td class="bodyText">	
		
 <form  action="ViewCustAllPhoneDetails.jsp" name="phonedetails" onsubmit="return checSNO();"> 
    
     <table align="center" WIDTH="430" border="0" bordercolor="black" bgcolor="#F4F5F7">
      <th colspan="2" bgcolor="#a4c2c2"><center><b><font color="white">Customer Phone Details</font></center></th>
      <tr rowspan="5"></tr>
      <tr>
    <td>
     <center>  </center>
    </td>
    </tr> 
          <tr><td><center>  <% if(request.getParameter("status")!=null)
					  {%>
                           <strong><font color=red><%=request.getParameter("status")%></font></strong>
                      <%}%></center></td></tr>
  
  
  
       <input type="hidden" name="port" value="<%=request.getLocalPort() %>"/>
 <input type="hidden" name="host" value="<%=request.getServerName() %>"/>
  
  
   <tr><td>Phone Type</td><td><select  name="ttypeid" >
  <option value="">-select-</option>
   <% CoreHash ch=new TelephoneDAO().getTelephoneTypeNames();
	             Enumeration em=ch.elements();
	             TelephoneModel p=null;
	             
	                    
	             while(em.hasMoreElements()){
	                   p=(TelephoneModel)em.nextElement();          
	              
	                   
	                  %>
              
                 <option  value="<%=p.getTeltypeid()%>"><%=p.getTeltypename()%></option>   
                    <%}%>
                  </select>
                   </td></tr> <br>
    
  
		
		 <%
                String loginname=(String)session.getAttribute("user"); 
String image=getServletContext().getRealPath("/userimages");

 
 CustomerModel cmodel=null;
 
       
       cmodel=new CustomerDAO().getCustProfile(image,loginname);
       int secno=cmodel.getCustid();
                          
         %> 
         
      <tr><td> Security No</td><td><input type="text" size="5"  name="sno" ></td></tr><br>
		
	<tr><td><input type="submit" name="submit"   value="View"></td></tr><br>	
		 </table>
	
		
		<%if(request.getParameter("submit")!=null){ %>
		
		 
<table align="center" WIDTH="900" border="0" bordercolor="black" bgcolor="#F4F5F7">
      <th colspan="15" bgcolor="#3179c8"><center><b><font color="white">View All Phone Bill Details</font></center></th>
      <tr rowspan="4"></tr>
          
       
                
                <%
               // String loginname=(String)session.getAttribute("user"); 
//String image=getServletContext().getRealPath("/userimages");
 TelephoneModel emodel=null; 
 
       try{      
       
       int ttypeid=Integer.parseInt(request.getParameter("ttypeid"));
       int sno=Integer.parseInt(request.getParameter("sno"));
       
       CoreHash ch1=new TelephoneDAO().getAllPhoneDetailsOfUser(sno,ttypeid);
         Enumeration em1=ch1.elements();
        if(ch1!=null){           
         %> 
                  
       <tr>
    <td>PH.No </td> 
    <td>PHONE TYPE</td>    
    <td>Security No</td>
    <td>Talk Time</td>          
    <td>BillIssueDate</td>      
    <td>Due Amount </td> 
    <td>Status</td>  
     <td>Pay Amount</td>  
    
    </tr>  
         <% while(em1.hasMoreElements()){
             emodel=(TelephoneModel)em1.nextElement();
             
             
         %>
        <tr> 
               <td ><a href="CustIsPayingPhoneBills.jsp?phno=<%=emodel.getTelphno()%>&ttypeid=<%=emodel.getTeltypeid() %>&secuno=<%=emodel.getSecurityno() %>"><%=emodel.getTelphno() %></a></td>
               <td value="<%=emodel.getTeltypeid() %>"><%=emodel.getTeltypename() %></td>                 
               <td ><%=emodel.getSecurityno() %></td>
               <td ><%=emodel.getTalktime() %></td>
               <td ><%=emodel.getBilisuedate() %></td>
               <td ><%=emodel.getDueamt() %></td>
               <td ><%=emodel.getStatus() %></td>
               <td ><%=emodel.getAmt2pay() %></td>
               
                     
          </tr>
        <%             
         }}else { %>
      
         <tr><td height="24" colspan="6"><div align="center" class="style7"><strong>Not Available</strong></div></td>
       <%}  }catch(Exception e){e.printStackTrace();}        
        %>  
      </table>
</form>

	<%}%>
       
	
	<table>	


	<tr bgcolor="#ffffff">
	<td colspan="6">`</td>
	</tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
    <tr></tr><tr></tr>
    
	<tr>
	<td height="20" colspan="6" bgcolor="#438464"><div align="right"><center><span class="style2 style1">&copy;All rights reserved </span></center></div></td>
	</tr>
</table>
</body>
</html>